import http from "@/api";

/**
 * 文章分页列表
 */
export const articlePageListApi = (params: object) => {
    return http.get(`/article/paging`, params);
};

/**
 * 新增文章
 * @param params
 */
export const addArticleApi = (params: object) => {
    return http.post(`/article/add`, params);
};

/**
 * 编辑文章
 * @param params
 */
export const editArticleApi = (params: any) => {
    return http.put(`/article/edit/${params.id}`, params);
};

/**
 * 切换文章状态
 * @param id
 */
export const changeStatusApi = (id: number) => {
    return http.put(`/article/change_status/${id}`);
};

/**
 * 修改排序
 * @param params
 */
export const changeSortApi = (params: object) => {
    return http.post(`/article/changeSort`, params);
};

/**
 * 删除文章
 * @param id
 */
export const deleteArticleByIdApi = (id: number) => {
    return http.delete(`/article/delete/${id}`);
};

/**
 * 批量删除
 * @param params
 */
export const deleteArticleApi = (params: object) => {
    return http.post(`/article/delete`, params);
};